﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_DMTaiKhoan : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboCapDo")]
        private ComboBox _CboCapDo;
        [AccessedThroughProperty("CboLoaiTaiKhoan")]
        private ComboBox _CboLoaiTaiKhoan;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CboNhom")]
        private ComboBox _CboNhom;
        [AccessedThroughProperty("CKBoPhan")]
        private CheckBox _CKBoPhan;
        [AccessedThroughProperty("CKCongNo")]
        private CheckBox _CKCongNo;
        [AccessedThroughProperty("CKDoiTuongCungCap")]
        private CheckBox _CKDoiTuongCungCap;
        [AccessedThroughProperty("CKHopDong")]
        private CheckBox _CKHopDong;
        [AccessedThroughProperty("CKKhachHang")]
        private CheckBox _CKKhachHang;
        [AccessedThroughProperty("CKNganHang")]
        private CheckBox _CKNganHang;
        [AccessedThroughProperty("CKNhanVien")]
        private CheckBox _CKNhanVien;
        [AccessedThroughProperty("CKQuy")]
        private CheckBox _CKQuy;
        [AccessedThroughProperty("CKSanPham")]
        private CheckBox _CKSanPham;
        [AccessedThroughProperty("CKTheoDoiGiaThanh")]
        private CheckBox _CKTheoDoiGiaThanh;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdHelp")]
        private ToolStripButton _CmdHelp;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripButton _CmdPrint;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("GrDoiTuong")]
        private GroupBox _GrDoiTuong;
        [AccessedThroughProperty("GroupBox3")]
        private GroupBox _GroupBox3;
        [AccessedThroughProperty("GroupBox4")]
        private GroupBox _GroupBox4;
        [AccessedThroughProperty("ImageList1")]
        private ImageList _ImageList1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("MenuThemTaiKhoan")]
        private ContextMenuStrip _MenuThemTaiKhoan;
        [AccessedThroughProperty("MnuThem")]
        private ToolStripMenuItem _MnuThem;
        [AccessedThroughProperty("OptBinhThuong")]
        private RadioButton _OptBinhThuong;
        [AccessedThroughProperty("OptDoiTuong")]
        private RadioButton _OptDoiTuong;
        [AccessedThroughProperty("OptKhongTheoDoiDoiTuong")]
        private RadioButton _OptKhongTheoDoiDoiTuong;
        [AccessedThroughProperty("Panel1")]
        private Panel _Panel1;
        [AccessedThroughProperty("Panel2")]
        private Panel _Panel2;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TVList")]
        private TreeView _TVList;
        [AccessedThroughProperty("TxtSoTaiKhoan")]
        private TextBox _TxtSoTaiKhoan;
        [AccessedThroughProperty("TxtTenAnh")]
        private TextBox _TxtTenAnh;
        [AccessedThroughProperty("TxtTenViet")]
        private TextBox _TxtTenViet;
        private DataView cFrmData;
        private string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnableControl;
        private int nIDX;
        private clsDMTaiKhoan objDMTK;
        private DataTable pDataNhom;
        private bool pLoadCapDo;
        private string strSoTaiKhoan;

        public Frm_DMTaiKhoan()
        {
            base.Load += new EventHandler(this.Frm_DMTaiKhoan_Load);
            base.FormClosing += new FormClosingEventHandler(this.Frm_DMTaiKhoan_FormClosing);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.cFrmKhoaOld = "";
            this.cFrmKhoa = "";
            this.cFrmTask = "";
            this.objDMTK = new clsDMTaiKhoan();
            this.strSoTaiKhoan = "";
            this.pLoadCapDo = false;
            this.InitializeComponent();
        }

        private void CboCapDo_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.CboCapDo.SelectedIndex <= 0)
            {
                this.CboNhom.DataSource = null;
            }
            else
            {
                this.pDataNhom = this.objDMTK.GetListNhom(this.CboCapDo.SelectedIndex);
                this.CboNhom.DataSource = this.pDataNhom;
                this.CboNhom.ValueMember = "Khoa";
                this.CboNhom.DisplayMember = "TenSoTaiKhoan";
                this.CboNhom.SelectedIndex = -1;
            }
            if (this.pLoadCapDo)
            {
                this.TxtSoTaiKhoan.MaxLength = Conversions.ToInteger(Microsoft.VisualBasic.CompilerServices.Operators.AddObject(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), 0, modGeneral.TypeOfValue.Nothing), 2));
            }
        }

        private void CboNhom_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.mEnableControl)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
                {
                    this.TxtSoTaiKhoan.Text = "";
                    this.CboLoaiTien.SelectedValue = "";
                    this.CKCongNo.CheckState = CheckState.Unchecked;
                    this.CKQuy.CheckState = CheckState.Unchecked;
                    this.CKTheoDoiGiaThanh.CheckState = CheckState.Unchecked;
                    this.CKBoPhan.CheckState = CheckState.Unchecked;
                    this.CKSanPham.CheckState = CheckState.Unchecked;
                    this.CKHopDong.CheckState = CheckState.Unchecked;
                }
                else
                {
                    this.objDMTK.Load(Conversions.ToString(this.CboNhom.SelectedValue));
                    clsDMTaiKhoan objDMTK = this.objDMTK;
                    this.TxtSoTaiKhoan.Text = objDMTK.SoTaiKhoan.Trim();
                    this.CboLoaiTien.SelectedValue = objDMTK.LoaiTien.Trim();
                    if (objDMTK.CongNo == 1)
                    {
                        this.CKCongNo.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKCongNo.CheckState = CheckState.Unchecked;
                    }
                    if (objDMTK.TonQuy == 1)
                    {
                        this.CKQuy.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKQuy.CheckState = CheckState.Unchecked;
                    }
                    if (objDMTK.TheoDoiTheoDoiTuong == 1)
                    {
                        this.OptDoiTuong.Checked = true;
                    }
                    else
                    {
                        this.OptKhongTheoDoiDoiTuong.Checked = true;
                    }
                    if (objDMTK.DoiTuongCungCap == 1)
                    {
                        this.CKDoiTuongCungCap.Checked = true;
                    }
                    else
                    {
                        this.CKDoiTuongCungCap.Checked = false;
                    }
                    if (objDMTK.DoiTuongKhachHang == 1)
                    {
                        this.CKKhachHang.Checked = true;
                    }
                    else
                    {
                        this.CKKhachHang.Checked = false;
                    }
                    if (objDMTK.DoiTuongNhanVien == 1)
                    {
                        this.CKNhanVien.Checked = true;
                    }
                    else
                    {
                        this.CKNhanVien.Checked = false;
                    }
                    if (objDMTK.DoiTuongNganHang == 1)
                    {
                        this.CKNganHang.Checked = true;
                    }
                    else
                    {
                        this.CKNganHang.Checked = false;
                    }
                    if (objDMTK.TaiKhoanGiaThanh == 1)
                    {
                        this.CKTheoDoiGiaThanh.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKTheoDoiGiaThanh.CheckState = CheckState.Unchecked;
                    }
                    if (objDMTK.BoPhan == 1)
                    {
                        this.CKBoPhan.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKBoPhan.CheckState = CheckState.Unchecked;
                    }
                    if (objDMTK.SanPham == 1)
                    {
                        this.CKSanPham.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKSanPham.CheckState = CheckState.Unchecked;
                    }
                    if (objDMTK.HopDong == 1)
                    {
                        this.CKHopDong.CheckState = CheckState.Checked;
                    }
                    else
                    {
                        this.CKHopDong.CheckState = CheckState.Unchecked;
                    }
                    objDMTK = null;
                }
            }
        }

        public bool CheckIvalid()
        {
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTaiKhoan.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại t\x00e0i khoản!", ""));
                this.CboLoaiTaiKhoan.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn cấp độ t\x00e0i khoản!", ""));
                this.CboCapDo.Focus();
                return false;
            }
            if ((LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "1") && (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == ""))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn nh\x00f3m t\x00e0i khoản!", ""));
                this.CboNhom.Focus();
                return false;
            }
            if (this.TxtSoTaiKhoan.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số t\x00e0i khoản!", ""));
                this.TxtSoTaiKhoan.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
            {
                clsDMTaiKhoan khoan = new clsDMTaiKhoan();
                khoan.Load(Conversions.ToString(this.CboNhom.SelectedValue));
                int length = khoan.SoTaiKhoan.Trim().Length;
                if (LVYModule.sLeft(this.TxtSoTaiKhoan.Text.Trim(), length) != khoan.SoTaiKhoan.Trim())
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Số t\x00e0i khoản kh\x00f4ng hợp lệ. Bạn phải nhập số t\x00e0i khoản bắt đầu bằng số t\x00e0i khoản của nh\x00f3m!", ""));
                    this.TxtSoTaiKhoan.Focus();
                    return false;
                }
            }
            if (this.TxtTenViet.Text.Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập t\x00ean t\x00e0i khoản", ""));
                this.TxtTenViet.Focus();
                return false;
            }
            if (this.OptDoiTuong.Checked && (((!this.CKDoiTuongCungCap.Checked & !this.CKKhachHang.Checked) & !this.CKNhanVien.Checked) & !this.CKNganHang.Checked))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại đối tượng theo d\x00f5i!", ""));
                return false;
            }
            if (this.CheckSoTaiKhoanTrung(this.TxtSoTaiKhoan.Text) & (this.cFrmTask == "A"))
            {
                LVYModule.ShowWarning("Bạn phải nhập số t\x00e0i khoản kh\x00e1c. Số t\x00e0i khoản n\x00e0y đ\x00e3 tồn tại trong danh mục !");
                return false;
            }
            if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), 0, modGeneral.TypeOfValue.Nothing), 1, false) && (this.TxtSoTaiKhoan.Text.Trim().Length != 3))
            {
                LVYModule.ShowWarning("Độ d\x00e0i số t\x00e0i khoản so với cấp độ 1 kh\x00f4ng ph\x00f9 hợp !");
                return false;
            }
            return true;
        }

        public bool CheckSoTaiKhoanTrung(string pSoTaiKhoan)
        {
            bool flag=false;
            string commandText = "";
            commandText = " SELECT * FROM DM_TaiKhoan WHERE RTrim(SoTaiKhoan) = RTrim('" + pSoTaiKhoan + "') ";
            try
            {
                if (DBHelper.ExecuteDataset(modGeneral.ConnectionString, CommandType.Text, commandText, new IDataParameter[0]).Tables[0].Rows.Count > 0)
                {
                    return true;
                }
                flag = false;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Exception exception = exception1;
                MessageBox.Show(exception.Message);
                flag = true;
                ProjectData.ClearProjectError();
                return flag;
                ProjectData.ClearProjectError();
            }
            return flag;
        }

        private void CKTheoDoiGiaThanh_CheckedChanged(object sender, EventArgs e)
        {
            this.CKBoPhan.Enabled = this.mEnableControl & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
            this.CKSanPham.Enabled = this.mEnableControl & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
            this.CKHopDong.Enabled = this.mEnableControl & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.objDMTK.Load(this.cFrmKhoaOld);
            this.CboCapDo.SelectedValue = this.objDMTK.CapDo + 1;
            this.CboNhom.SelectedValue = this.objDMTK.Khoa;
            if ((this.objDMTK.CapDo + 1) > 4)
            {
                LVYModule.ShowWarning("T\x00e0i khoản đ\x00e3 vượt cấp kh\x00f4ng thể th\x00eam nữa !");
            }
            else
            {
                this.cFrmKhoa = modGeneral.CreatKey("DM_TaiKhoan", 10, "");
                this.cFrmTask = "A";
                this.EmptyData();
                this.EnableControl = true;
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (this.objDMTK.CodeWasUsed(this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Th\x00f4ng tin n\x00e0y đ\x00e3 được sử dụng. Bạn kh\x00f4ng thể x\x00f3a!", ""));
            }
            else if (LVYModule.ConfirmDelete("") && this.objDMTK.DelData(this.cFrmKhoa))
            {
                this.RemoveNode(this.cFrmKhoa);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmTask = "E";
                this.EnableControl = true;
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                TreeNode node = new TreeNode();
                clsDMTaiKhoan objDMTK = this.objDMTK;
                objDMTK.Khoa = this.cFrmKhoa;
                objDMTK.CapDo = Conversions.ToInteger(this.CboCapDo.SelectedValue);
                objDMTK.TenViet = this.TxtTenViet.Text;
                objDMTK.TenAnh = this.TxtTenAnh.Text;
                objDMTK.NhomTaiKhoan = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(this.CboCapDo.SelectedValue, 1, false))
                {
                    DataTable table = new DataTable();
                    if (this.objDMTK.GetTaiKhoanDinhKhoan(this.CboNhom.SelectedValue.ToString()).Rows.Count > 1)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng thể th\x00eam t\x00e0i khoản con v\x00ec t\x00e0i khoản n\x00e0y đ\x00e3 được định khoản!", ""));
                        return;
                    }
                }
                objDMTK.SoTaiKhoan = this.TxtSoTaiKhoan.Text;
                objDMTK.LoaiTien = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                objDMTK.PhanLoai = Conversions.ToString(this.CboLoaiTaiKhoan.SelectedValue);
                if (this.CKBoPhan.CheckState == CheckState.Checked)
                {
                    objDMTK.BoPhan = 1;
                }
                else
                {
                    objDMTK.BoPhan = 0;
                }
                if (this.CKSanPham.CheckState == CheckState.Checked)
                {
                    objDMTK.SanPham = 1;
                }
                else
                {
                    objDMTK.SanPham = 0;
                }
                if (this.CKCongNo.CheckState == CheckState.Checked)
                {
                    objDMTK.CongNo = 1;
                }
                else
                {
                    objDMTK.CongNo = 0;
                }
                if (this.CKQuy.CheckState == CheckState.Checked)
                {
                    objDMTK.TonQuy = 1;
                }
                else
                {
                    objDMTK.TonQuy = 0;
                }
                if (this.OptDoiTuong.Checked)
                {
                    objDMTK.TheoDoiTheoDoiTuong = 1;
                    if (this.CKNhanVien.Checked)
                    {
                        objDMTK.DoiTuongNhanVien = 1;
                    }
                    else
                    {
                        objDMTK.DoiTuongNhanVien = 0;
                    }
                    if (this.CKKhachHang.Checked)
                    {
                        objDMTK.DoiTuongKhachHang = 1;
                    }
                    else
                    {
                        objDMTK.DoiTuongKhachHang = 0;
                    }
                    if (this.CKDoiTuongCungCap.Checked)
                    {
                        objDMTK.DoiTuongCungCap = 1;
                    }
                    else
                    {
                        objDMTK.DoiTuongCungCap = 0;
                    }
                    if (this.CKNganHang.Checked)
                    {
                        objDMTK.DoiTuongNganHang = 1;
                    }
                    else
                    {
                        objDMTK.DoiTuongNganHang = 0;
                    }
                }
                else
                {
                    objDMTK.TheoDoiTheoDoiTuong = 0;
                    objDMTK.DoiTuongNhanVien = 0;
                    objDMTK.DoiTuongKhachHang = 0;
                    objDMTK.DoiTuongCungCap = 0;
                    objDMTK.DoiTuongNganHang = 0;
                }
                if (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked)
                {
                    objDMTK.TaiKhoanGiaThanh = 1;
                }
                else
                {
                    objDMTK.TaiKhoanGiaThanh = 0;
                }
                if (this.CKBoPhan.CheckState == CheckState.Checked)
                {
                    objDMTK.BoPhan = 1;
                }
                else
                {
                    objDMTK.BoPhan = 0;
                }
                if (this.CKSanPham.CheckState == CheckState.Checked)
                {
                    objDMTK.SanPham = 1;
                }
                else
                {
                    objDMTK.SanPham = 0;
                }
                if (this.CKHopDong.CheckState == CheckState.Checked)
                {
                    objDMTK.HopDong = 1;
                }
                else
                {
                    objDMTK.HopDong = 0;
                }
                objDMTK.LoaiTien = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
                objDMTK.LoaiTaiKhoan = "";
                objDMTK.LoaiPhienBan = modGeneral.H_PHIENBANQUYETDINH;
                if (objDMTK.Save())
                {
                    string text;
                    objDMTK = null;
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        text = this.TxtTenViet.Text;
                    }
                    else
                    {
                        text = this.TxtTenAnh.Text;
                    }
                    this.mLoadData();
                    this.EnableControl = false;
                }
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            if (this.cFrmTask == "E")
            {
                this.ShowData(this.cFrmKhoa);
            }
            else if (this.cFrmKhoaOld != "")
            {
                this.cFrmKhoa = this.cFrmKhoaOld;
                this.ShowData(this.cFrmKhoa);
            }
            else
            {
                this.EmptyData();
            }
            this.EnableControl = false;
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoTaiKhoan.Text = "";
            this.TxtTenAnh.Text = "";
            this.TxtTenViet.Text = "";
            this.CboCapDo.SelectedValue = "";
            this.CKNganHang.Checked = false;
            this.CKDoiTuongCungCap.Checked = false;
            this.CKNhanVien.Checked = false;
            this.CKKhachHang.Checked = false;
            this.CboLoaiTaiKhoan.SelectedValue = "";
            this.CboLoaiTien.SelectedValue = "";
            this.CboNhom.SelectedValue = "";
            this.CKCongNo.CheckState = CheckState.Unchecked;
            this.CKQuy.CheckState = CheckState.Unchecked;
            this.CKTheoDoiGiaThanh.CheckState = CheckState.Unchecked;
            this.CKBoPhan.CheckState = CheckState.Unchecked;
            this.CKSanPham.CheckState = CheckState.Unchecked;
            this.CKHopDong.CheckState = CheckState.Unchecked;
        }

        private void Frm_DMTaiKhoan_FormClosing(object sender, FormClosingEventArgs e)
        {
            LVYModule.InitDataDefault();
        }

        private void Frm_DMTaiKhoan_Load(object sender, EventArgs e)
        {
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.CboLoaiTaiKhoan.DataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000003");
                this.CboLoaiTaiKhoan.ValueMember = "Ma";
                this.CboLoaiTaiKhoan.DisplayMember = "Ten";
                this.pLoadCapDo = false;
                this.CboCapDo.DataSource = modGeneral.H_DUNGCHUNG.ShowList("0000000002");
                this.CboCapDo.ValueMember = "Ma";
                this.CboCapDo.DisplayMember = "Ten";
                this.pLoadCapDo = true;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                this.CboLoaiTaiKhoan.SelectedIndex = -1;
                this.CboCapDo.SelectedIndex = -1;
                this.EnableControl = false;
                this.mLoadData();
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_DMTaiKhoan));
            this.TVList = new TreeView();
            this.MenuThemTaiKhoan = new ContextMenuStrip(this.components);
            this.MnuThem = new ToolStripMenuItem();
            this.ImageList1 = new ImageList(this.components);
            this.Panel1 = new Panel();
            this.Panel2 = new Panel();
            this.OptDoiTuong = new RadioButton();
            this.OptKhongTheoDoiDoiTuong = new RadioButton();
            this.GrDoiTuong = new GroupBox();
            this.CKNganHang = new CheckBox();
            this.CKNhanVien = new CheckBox();
            this.CKKhachHang = new CheckBox();
            this.CKDoiTuongCungCap = new CheckBox();
            this.GroupBox4 = new GroupBox();
            this.CKHopDong = new CheckBox();
            this.CKTheoDoiGiaThanh = new CheckBox();
            this.CKSanPham = new CheckBox();
            this.CKBoPhan = new CheckBox();
            this.GroupBox3 = new GroupBox();
            this.OptBinhThuong = new RadioButton();
            this.CKQuy = new CheckBox();
            this.CKCongNo = new CheckBox();
            this.Label7 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.Label6 = new Label();
            this.TxtTenAnh = new TextBox();
            this.Label5 = new Label();
            this.TxtTenViet = new TextBox();
            this.Label4 = new Label();
            this.TxtSoTaiKhoan = new TextBox();
            this.Label3 = new Label();
            this.CboNhom = new ComboBox();
            this.Label2 = new Label();
            this.CboCapDo = new ComboBox();
            this.Label1 = new Label();
            this.CboLoaiTaiKhoan = new ComboBox();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripButton();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.CmdHelp = new ToolStripButton();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.MenuThemTaiKhoan.SuspendLayout();
            this.Panel2.SuspendLayout();
            this.GrDoiTuong.SuspendLayout();
            this.GroupBox4.SuspendLayout();
            this.GroupBox3.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.SuspendLayout();
            this.TVList.ContextMenuStrip = this.MenuThemTaiKhoan;
            this.TVList.Dock = DockStyle.Fill;
            this.TVList.ImageIndex = 0;
            this.TVList.ImageList = this.ImageList1;
            Point point = new Point(0, 0);
            this.TVList.Location = point;
            this.TVList.Name = "TVList";
            this.TVList.SelectedImageIndex = 0;
            Size size = new Size(0x139, 0x1c3);
            this.TVList.Size = size;
            this.TVList.TabIndex = 1;
            this.MenuThemTaiKhoan.Items.AddRange(new ToolStripItem[] { this.MnuThem });
            this.MenuThemTaiKhoan.Name = "MenuThemTaiKhoan";
            size = new Size(0xb5, 0x1a);
            this.MenuThemTaiKhoan.Size = size;
            this.MnuThem.Name = "MnuThem";
            size = new Size(180, 0x16);
            this.MnuThem.Size = size;
            this.MnuThem.Text = "Th\x00eam t\x00e0i khoản con";
            this.ImageList1.ImageStream = (ImageListStreamer) manager.GetObject("ImageList1.ImageStream");
            this.ImageList1.TransparentColor = Color.Transparent;
            this.ImageList1.Images.SetKeyName(0, "book.gif");
            this.ImageList1.Images.SetKeyName(1, "bookopen.gif");
            this.Panel1.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.Panel1.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1c3);
            this.Panel1.Location = point;
            this.Panel1.Name = "Panel1";
            size = new Size(0x139, 0x20);
            this.Panel1.Size = size;
            this.Panel1.TabIndex = 0;
            this.Panel2.BackColor = Color.Transparent;
            this.Panel2.Controls.Add(this.OptDoiTuong);
            this.Panel2.Controls.Add(this.OptKhongTheoDoiDoiTuong);
            this.Panel2.Controls.Add(this.GrDoiTuong);
            point = new Point(14, 0x13d);
            this.Panel2.Location = point;
            this.Panel2.Name = "Panel2";
            size = new Size(0x159, 0xa2);
            this.Panel2.Size = size;
            this.Panel2.TabIndex = 0x12;
            this.OptDoiTuong.AutoSize = true;
            point = new Point(0x17, 0x25);
            this.OptDoiTuong.Location = point;
            this.OptDoiTuong.Name = "OptDoiTuong";
            size = new Size(0x8b, 0x11);
            this.OptDoiTuong.Size = size;
            this.OptDoiTuong.TabIndex = 8;
            this.OptDoiTuong.Text = "Theo d\x00f5i theo đối tượng";
            this.OptDoiTuong.UseVisualStyleBackColor = true;
            this.OptKhongTheoDoiDoiTuong.AutoSize = true;
            this.OptKhongTheoDoiDoiTuong.Checked = true;
            point = new Point(0x16, 11);
            this.OptKhongTheoDoiDoiTuong.Location = point;
            this.OptKhongTheoDoiDoiTuong.Name = "OptKhongTheoDoiDoiTuong";
            size = new Size(0xa9, 0x11);
            this.OptKhongTheoDoiDoiTuong.Size = size;
            this.OptKhongTheoDoiDoiTuong.TabIndex = 7;
            this.OptKhongTheoDoiDoiTuong.TabStop = true;
            this.OptKhongTheoDoiDoiTuong.Text = "Kh\x00f4ng theo d\x00f5i theo đối tượng";
            this.OptKhongTheoDoiDoiTuong.UseVisualStyleBackColor = true;
            this.GrDoiTuong.Controls.Add(this.CKNganHang);
            this.GrDoiTuong.Controls.Add(this.CKNhanVien);
            this.GrDoiTuong.Controls.Add(this.CKKhachHang);
            this.GrDoiTuong.Controls.Add(this.CKDoiTuongCungCap);
            point = new Point(0x10, 0x26);
            this.GrDoiTuong.Location = point;
            this.GrDoiTuong.Name = "GrDoiTuong";
            size = new Size(310, 0x68);
            this.GrDoiTuong.Size = size;
            this.GrDoiTuong.TabIndex = 10;
            this.GrDoiTuong.TabStop = false;
            this.CKNganHang.AutoSize = true;
            point = new Point(0x9a, 0x3b);
            this.CKNganHang.Location = point;
            this.CKNganHang.Name = "CKNganHang";
            size = new Size(0x4f, 0x11);
            this.CKNganHang.Size = size;
            this.CKNganHang.TabIndex = 0x16;
            this.CKNganHang.Text = "Ng\x00e2n h\x00e0ng";
            this.CKNganHang.UseVisualStyleBackColor = true;
            this.CKNhanVien.AutoSize = true;
            point = new Point(0x9a, 0x24);
            this.CKNhanVien.Location = point;
            this.CKNhanVien.Name = "CKNhanVien";
            size = new Size(0x4b, 0x11);
            this.CKNhanVien.Size = size;
            this.CKNhanVien.TabIndex = 0x15;
            this.CKNhanVien.Text = "Nh\x00e2n vi\x00ean";
            this.CKNhanVien.UseVisualStyleBackColor = true;
            this.CKKhachHang.AutoSize = true;
            point = new Point(0x29, 0x3b);
            this.CKKhachHang.Location = point;
            this.CKKhachHang.Name = "CKKhachHang";
            size = new Size(0x54, 0x11);
            this.CKKhachHang.Size = size;
            this.CKKhachHang.TabIndex = 20;
            this.CKKhachHang.Text = "Kh\x00e1ch h\x00e0ng";
            this.CKKhachHang.UseVisualStyleBackColor = true;
            this.CKDoiTuongCungCap.AutoSize = true;
            point = new Point(0x29, 0x24);
            this.CKDoiTuongCungCap.Location = point;
            this.CKDoiTuongCungCap.Name = "CKDoiTuongCungCap";
            size = new Size(0x5e, 0x11);
            this.CKDoiTuongCungCap.Size = size;
            this.CKDoiTuongCungCap.TabIndex = 0x13;
            this.CKDoiTuongCungCap.Text = "Nh\x00e0 cung cấp";
            this.CKDoiTuongCungCap.UseVisualStyleBackColor = true;
            this.GroupBox4.BackColor = Color.Transparent;
            this.GroupBox4.Controls.Add(this.CKHopDong);
            this.GroupBox4.Controls.Add(this.CKTheoDoiGiaThanh);
            this.GroupBox4.Controls.Add(this.CKSanPham);
            this.GroupBox4.Controls.Add(this.CKBoPhan);
            point = new Point(0xc2, 0xd0);
            this.GroupBox4.Location = point;
            this.GroupBox4.Name = "GroupBox4";
            size = new Size(0xa5, 100);
            this.GroupBox4.Size = size;
            this.GroupBox4.TabIndex = 0x11;
            this.GroupBox4.TabStop = false;
            this.CKHopDong.AutoSize = true;
            point = new Point(12, 0x4a);
            this.CKHopDong.Location = point;
            this.CKHopDong.Name = "CKHopDong";
            size = new Size(0x8d, 0x11);
            this.CKHopDong.Size = size;
            this.CKHopDong.TabIndex = 20;
            this.CKHopDong.Text = "Theo d\x00f5i theo hợp đồng";
            this.CKHopDong.UseVisualStyleBackColor = true;
            this.CKTheoDoiGiaThanh.AutoSize = true;
            point = new Point(12, -1);
            this.CKTheoDoiGiaThanh.Location = point;
            this.CKTheoDoiGiaThanh.Name = "CKTheoDoiGiaThanh";
            size = new Size(0x48, 0x11);
            this.CKTheoDoiGiaThanh.Size = size;
            this.CKTheoDoiGiaThanh.TabIndex = 15;
            this.CKTheoDoiGiaThanh.Text = "Gi\x00e1 th\x00e0nh";
            this.CKTheoDoiGiaThanh.UseVisualStyleBackColor = true;
            this.CKSanPham.AutoSize = true;
            point = new Point(12, 0x33);
            this.CKSanPham.Location = point;
            this.CKSanPham.Name = "CKSanPham";
            size = new Size(0x8d, 0x11);
            this.CKSanPham.Size = size;
            this.CKSanPham.TabIndex = 0x13;
            this.CKSanPham.Text = "Theo d\x00f5i theo sản phẩm";
            this.CKSanPham.UseVisualStyleBackColor = true;
            this.CKBoPhan.AutoSize = true;
            point = new Point(12, 0x1c);
            this.CKBoPhan.Location = point;
            this.CKBoPhan.Name = "CKBoPhan";
            size = new Size(0x86, 0x11);
            this.CKBoPhan.Size = size;
            this.CKBoPhan.TabIndex = 0x12;
            this.CKBoPhan.Text = "Theo d\x00f5i theo bộ phận";
            this.CKBoPhan.UseVisualStyleBackColor = true;
            this.GroupBox3.BackColor = Color.Transparent;
            this.GroupBox3.Controls.Add(this.OptBinhThuong);
            this.GroupBox3.Controls.Add(this.CKQuy);
            this.GroupBox3.Controls.Add(this.CKCongNo);
            point = new Point(12, 0xd0);
            this.GroupBox3.Location = point;
            this.GroupBox3.Name = "GroupBox3";
            size = new Size(0xb0, 100);
            this.GroupBox3.Size = size;
            this.GroupBox3.TabIndex = 15;
            this.GroupBox3.TabStop = false;
            this.GroupBox3.Text = "Thuộc t\x00ednh t\x00e0i khoản";
            this.OptBinhThuong.AutoSize = true;
            this.OptBinhThuong.Checked = true;
            point = new Point(-8, 0xc0);
            this.OptBinhThuong.Location = point;
            this.OptBinhThuong.Name = "OptBinhThuong";
            size = new Size(0x84, 0x11);
            this.OptBinhThuong.Size = size;
            this.OptBinhThuong.TabIndex = 12;
            this.OptBinhThuong.TabStop = true;
            this.OptBinhThuong.Text = "T\x00e0i khoản b\x00ecnh thường";
            this.OptBinhThuong.UseVisualStyleBackColor = true;
            this.CKQuy.AutoSize = true;
            point = new Point(0x18, 0x33);
            this.CKQuy.Location = point;
            this.CKQuy.Name = "CKQuy";
            size = new Size(0x5e, 0x11);
            this.CKQuy.Size = size;
            this.CKQuy.TabIndex = 11;
            this.CKQuy.Text = "T\x00e0i khoản quỹ";
            this.CKQuy.UseVisualStyleBackColor = true;
            this.CKCongNo.AutoSize = true;
            point = new Point(0x18, 0x1c);
            this.CKCongNo.Location = point;
            this.CKCongNo.Name = "CKCongNo";
            size = new Size(0x74, 0x11);
            this.CKCongNo.Size = size;
            this.CKCongNo.TabIndex = 10;
            this.CKCongNo.Text = "T\x00e0i khoản c\x00f4ng nợ";
            this.CKCongNo.UseVisualStyleBackColor = true;
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(14, 0xad);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            size = new Size(0x2f, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 13;
            this.Label7.Text = "Loại tiền";
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x6f, 0xa9);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(0xf8, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 6;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(13, 0x92);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x54, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 11;
            this.Label6.Text = "T\x00ean (Tiếng Anh)";
            point = new Point(0x6f, 0x8e);
            this.TxtTenAnh.Location = point;
            this.TxtTenAnh.Name = "TxtTenAnh";
            size = new Size(0xf8, 20);
            this.TxtTenAnh.Size = size;
            this.TxtTenAnh.TabIndex = 5;
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(13, 0x76);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x53, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 9;
            this.Label5.Text = "T\x00ean (Tiếng Việt)";
            point = new Point(0x6f, 0x73);
            this.TxtTenViet.Location = point;
            this.TxtTenViet.Name = "TxtTenViet";
            size = new Size(0xf8, 20);
            this.TxtTenViet.Size = size;
            this.TxtTenViet.TabIndex = 4;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(13, 0x5c);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x43, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 7;
            this.Label4.Text = "Số t\x00e0i khoản";
            point = new Point(0x6f, 0x58);
            this.TxtSoTaiKhoan.Location = point;
            this.TxtSoTaiKhoan.Name = "TxtSoTaiKhoan";
            size = new Size(0x7f, 20);
            this.TxtSoTaiKhoan.Size = size;
            this.TxtSoTaiKhoan.TabIndex = 3;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(13, 0x41);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            size = new Size(0x52, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 5;
            this.Label3.Text = "Nh\x00f3m t\x00e0i khoản";
            this.CboNhom.FormattingEnabled = true;
            point = new Point(0x6f, 0x3d);
            this.CboNhom.Location = point;
            this.CboNhom.Name = "CboNhom";
            size = new Size(0xf8, 0x15);
            this.CboNhom.Size = size;
            this.CboNhom.TabIndex = 2;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(13, 0x26);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(0x2a, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 3;
            this.Label2.Text = "Cấp độ";
            this.CboCapDo.FormattingEnabled = true;
            point = new Point(0x6f, 0x22);
            this.CboCapDo.Location = point;
            this.CboCapDo.Name = "CboCapDo";
            size = new Size(0xf8, 0x15);
            this.CboCapDo.Size = size;
            this.CboCapDo.TabIndex = 1;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(13, 11);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x33, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 1;
            this.Label1.Text = "Ph\x00e2n loại";
            this.CboLoaiTaiKhoan.FormattingEnabled = true;
            point = new Point(0x6f, 7);
            this.CboLoaiTaiKhoan.Location = point;
            this.CboLoaiTaiKhoan.Name = "CboLoaiTaiKhoan";
            size = new Size(0xf8, 0x15);
            this.CboLoaiTaiKhoan.Size = size;
            this.CboLoaiTaiKhoan.TabIndex = 0;
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdDel, this.ToolStripSeparator3, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdExit, this.CmdHelp });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x2b6, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 0x11;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdFind.Visible = false;
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x25, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.CmdHelp.Image = (Image) manager.GetObject("CmdHelp.Image");
            this.CmdHelp.ImageTransparentColor = Color.White;
            this.CmdHelp.Name = "CmdHelp";
            size = new Size(0x48, 0x16);
            this.CmdHelp.Size = size;
            this.CmdHelp.Text = "Trợ gi\x00fap";
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Left;
            point = new Point(0, 0x19);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0x13b, 0x1fd);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 0x13;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.TVList);
            this.C1DockingTabPage1.Controls.Add(this.Panel1);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x139, 0x1e3);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Danh s\x00e1ch t\x00e0i khoản";
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Dock = DockStyle.Fill;
            point = new Point(0x13b, 0x19);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x17b, 0x1fd);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 20;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.Panel2);
            this.C1DockingTabPage2.Controls.Add(this.Label1);
            this.C1DockingTabPage2.Controls.Add(this.GroupBox4);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiTaiKhoan);
            this.C1DockingTabPage2.Controls.Add(this.GroupBox3);
            this.C1DockingTabPage2.Controls.Add(this.CboCapDo);
            this.C1DockingTabPage2.Controls.Add(this.Label7);
            this.C1DockingTabPage2.Controls.Add(this.Label2);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage2.Controls.Add(this.CboNhom);
            this.C1DockingTabPage2.Controls.Add(this.Label6);
            this.C1DockingTabPage2.Controls.Add(this.Label3);
            this.C1DockingTabPage2.Controls.Add(this.TxtTenAnh);
            this.C1DockingTabPage2.Controls.Add(this.TxtSoTaiKhoan);
            this.C1DockingTabPage2.Controls.Add(this.Label5);
            this.C1DockingTabPage2.Controls.Add(this.Label4);
            this.C1DockingTabPage2.Controls.Add(this.TxtTenViet);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x179, 0x1e3);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Th\x00f4ng tin chi tiết";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            //this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x2b6, 0x216);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.ToolStrip1);
            //this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.KeyPreview = true;
            this.Name = "Frm_DMTaiKhoan";
            this.ShowIcon = false;
            this.ShowInTaskbar = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "DM-0001             ";
            this.Text = "DANH MUC TAI KHOAN";
            this.MenuThemTaiKhoan.ResumeLayout(false);
            this.Panel2.ResumeLayout(false);
            this.Panel2.PerformLayout();
            this.GrDoiTuong.ResumeLayout(false);
            this.GrDoiTuong.PerformLayout();
            this.GroupBox4.ResumeLayout(false);
            this.GroupBox4.PerformLayout();
            this.GroupBox3.ResumeLayout(false);
            this.GroupBox3.PerformLayout();
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.C1DockingTabPage2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        private void mLoadData()
        {
            DataTable list = new DataTable();
            TreeNode node = new TreeNode();
            try
            {
                list = this.objDMTK.GetList();
                if (list.Rows.Count == 0)
                {
                    return;
                }
                TreeView tVList = this.TVList;
                tVList.Nodes.Clear();
                int num2 = list.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    if (Strings.Trim(Conversions.ToString(list.Rows[i]["NhomTaiKhoan"])) != "")
                    {
                        if (this.mSearchParentNode(Strings.Trim(Conversions.ToString(list.Rows[i]["NhomTaiKhoan"])), Conversions.ToString(list.Rows[i]["Khoa"]), list.Rows[i]["SoTaiKhoan"].ToString().Trim() + "." + list.Rows[i]["Ten" + modGeneral.H_LANGUAGE].ToString().Trim()) == null)
                        {
                            tVList.Nodes.Add(Conversions.ToString(list.Rows[i]["Khoa"]), list.Rows[i]["SoTaiKhoan"].ToString().Trim() + "." + list.Rows[i]["Ten" + modGeneral.H_LANGUAGE].ToString().Trim(), 0, 1);
                        }
                    }
                    else
                    {
                        tVList.Nodes.Add(Conversions.ToString(list.Rows[i]["Khoa"]), list.Rows[i]["SoTaiKhoan"].ToString().Trim() + "." + list.Rows[i]["Ten" + modGeneral.H_LANGUAGE].ToString().Trim(), 0, 1);
                    }
                }
                tVList = null;
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Interaction.MsgBox(exception1.ToString(), MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
            list = null;
            if (this.TVList.Nodes.Count > 0)
            {
                this.TVList.SelectedNode = this.TVList.Nodes[0];
            }
        }

        private void MnuThem_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.objDMTK.Load(this.cFrmKhoaOld);
            this.CboCapDo.SelectedValue = this.objDMTK.CapDo + 1;
            this.CboNhom.SelectedValue = this.objDMTK.Khoa;
            if ((this.objDMTK.CapDo + 1) > 4)
            {
                LVYModule.ShowWarning("T\x00e0i khoản đ\x00e3 vượt cấp kh\x00f4ng thể th\x00eam nữa !");
            }
            else
            {
                this.cFrmKhoa = modGeneral.CreatKey("DM_TaiKhoan", 10, "");
                this.cFrmTask = "A";
                this.EnableControl = true;
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectEqual(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), 0, modGeneral.TypeOfValue.Nothing), 1, false))
                {
                    this.strSoTaiKhoan = "";
                    this.TxtSoTaiKhoan.MaxLength = 3;
                }
                else
                {
                    this.TxtSoTaiKhoan.Focus();
                    this.strSoTaiKhoan = this.TxtSoTaiKhoan.Text.Trim();
                    this.TxtSoTaiKhoan.MaxLength = this.strSoTaiKhoan.Length + 1;
                }
                this.CboCapDo.Enabled = false;
                this.CboLoaiTaiKhoan.Enabled = false;
                this.CboNhom.Enabled = false;
            }
        }

        public TreeNode mSearchParentNode(string pValue, string pID, string pText)
        {
            TreeNode node2 = new TreeNode();
            try
            {
                TreeNode[] nodeArray = this.TVList.Nodes.Find(pValue, true);
                int num2 = nodeArray.Length - 1;
                for (int i = 0; i <= num2; i++)
                {
                    node2 = nodeArray[i].Nodes.Add(pID, pText, 0, 1);
                }
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Interaction.MsgBox(exception1.ToString(), MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
            return node2;
        }

        private void OptKhongTheoDoiDoiTuong_CheckedChanged(object sender, EventArgs e)
        {
            if (this.OptKhongTheoDoiDoiTuong.Checked)
            {
                this.GrDoiTuong.Enabled = false;
            }
            else
            {
                this.GrDoiTuong.Enabled = true & this.mEnableControl;
            }
        }

        public void RemoveNode(string pID)
        {
            TreeNode node = new TreeNode();
            try
            {
                TreeNode[] nodeArray = this.TVList.Nodes.Find(pID, true);
                node = nodeArray[nodeArray.Length - 1];
                nodeArray[nodeArray.Length - 1].Nodes.Remove(node);
            }
            catch (Exception exception1)
            {
                ProjectData.SetProjectError(exception1);
                Interaction.MsgBox(exception1.ToString(), MsgBoxStyle.OkOnly, null);
                ProjectData.ClearProjectError();
            }
        }

        public int SearchByKey(string pKey)
        {
            int num3 = this.TVList.Nodes.Count - 1;
            int num = 0;
            while (num <= num3)
            {
                if (this.TVList.Nodes[num].Name == pKey)
                {
                    return num;
                }
                num++;
            }
            return num;
        }

        public void ShowData(string pKhoa)
        {
            if (LVYModule.ReturnIfNull(pKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                string str = "";
                clsDMTaiKhoan objDMTK = this.objDMTK;
                objDMTK.Load(pKhoa);
                this.cFrmKhoa = objDMTK.Khoa;
                this.CboLoaiTaiKhoan.SelectedValue = objDMTK.PhanLoai.Trim();
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboCapDo.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != objDMTK.CapDo.ToString().Trim())
                {
                    str = objDMTK.CapDo.ToString().Trim();
                    this.CboCapDo.SelectedValue = str;
                }
                this.CboNhom.SelectedValue = objDMTK.NhomTaiKhoan.Trim();
                this.TxtSoTaiKhoan.Text = objDMTK.SoTaiKhoan.Trim();
                this.TxtTenAnh.Text = objDMTK.TenAnh.Trim();
                this.TxtTenViet.Text = objDMTK.TenViet.Trim();
                this.CboLoaiTien.SelectedValue = objDMTK.LoaiTien.Trim();
                if (Microsoft.VisualBasic.CompilerServices.Operators.ConditionalCompareObjectGreater(this.CboCapDo.SelectedValue, 1, false))
                {
                    DataTable table = new DataTable();
                    if (this.objDMTK.GetTaiKhoanDinhKhoan(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboNhom.SelectedValue), "", modGeneral.TypeOfValue.Nothing))).Rows.Count > 1)
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng thể th\x00eam t\x00e0i khoản con v\x00ec t\x00e0i khoản n\x00e0y đ\x00e3 được định khoản!", ""));
                        return;
                    }
                }
                if (objDMTK.CongNo == 1)
                {
                    this.CKCongNo.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKCongNo.CheckState = CheckState.Unchecked;
                }
                if (objDMTK.TonQuy == 1)
                {
                    this.CKQuy.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKQuy.CheckState = CheckState.Unchecked;
                }
                if (objDMTK.TheoDoiTheoDoiTuong == 1)
                {
                    this.OptDoiTuong.Checked = true;
                }
                else
                {
                    this.OptKhongTheoDoiDoiTuong.Checked = true;
                }
                if (objDMTK.DoiTuongCungCap == 1)
                {
                    this.CKDoiTuongCungCap.Checked = true;
                }
                else
                {
                    this.CKDoiTuongCungCap.Checked = false;
                }
                if (objDMTK.DoiTuongKhachHang == 1)
                {
                    this.CKKhachHang.Checked = true;
                }
                else
                {
                    this.CKKhachHang.Checked = false;
                }
                if (objDMTK.DoiTuongNhanVien == 1)
                {
                    this.CKNhanVien.Checked = true;
                }
                else
                {
                    this.CKNhanVien.Checked = false;
                }
                if (objDMTK.DoiTuongNganHang == 1)
                {
                    this.CKNganHang.Checked = true;
                }
                else
                {
                    this.CKNganHang.Checked = false;
                }
                if (objDMTK.TaiKhoanGiaThanh == 1)
                {
                    this.CKTheoDoiGiaThanh.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKTheoDoiGiaThanh.CheckState = CheckState.Unchecked;
                }
                if (objDMTK.BoPhan == 1)
                {
                    this.CKBoPhan.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKBoPhan.CheckState = CheckState.Unchecked;
                }
                if (objDMTK.SanPham == 1)
                {
                    this.CKSanPham.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKSanPham.CheckState = CheckState.Unchecked;
                }
                if (objDMTK.HopDong == 1)
                {
                    this.CKHopDong.CheckState = CheckState.Checked;
                }
                else
                {
                    this.CKHopDong.CheckState = CheckState.Unchecked;
                }
                objDMTK = null;
            }
        }

        private void TVList_AfterSelect(object sender, TreeViewEventArgs e)
        {
            string pKey = "";
            pKey = e.Node.Name.Trim();
            this.nIDX = this.SearchByKey(pKey);
            this.ShowData(pKey);
        }

        private void TVList_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
        {
            if (e.Button == MouseButtons.Right)
            {
                this.TVList.SelectedNode = e.Node;
            }
        }

        private void TxtSoTaiKhoan_KeyPress(object sender, KeyPressEventArgs e)
        {
            if (!char.IsDigit(e.KeyChar) & !char.IsControl(e.KeyChar))
            {
                e.Handled = true;
            }
        }

        private void TxtSoTaiKhoan_TextChanged(object sender, EventArgs e)
        {
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboCapDo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboCapDo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboCapDo_SelectedIndexChanged);
                if (this._CboCapDo != null)
                {
                    this._CboCapDo.SelectedIndexChanged -= handler;
                }
                this._CboCapDo = value;
                if (this._CboCapDo != null)
                {
                    this._CboCapDo.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual ComboBox CboLoaiTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiTaiKhoan = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiTien = value;
            }
        }

        internal virtual ComboBox CboNhom
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboNhom;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboNhom_SelectedIndexChanged);
                if (this._CboNhom != null)
                {
                    this._CboNhom.SelectedIndexChanged -= handler;
                }
                this._CboNhom = value;
                if (this._CboNhom != null)
                {
                    this._CboNhom.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKBoPhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKBoPhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKBoPhan = value;
            }
        }

        internal virtual CheckBox CKCongNo
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKCongNo;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKCongNo = value;
            }
        }

        internal virtual CheckBox CKDoiTuongCungCap
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKDoiTuongCungCap;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKDoiTuongCungCap = value;
            }
        }

        internal virtual CheckBox CKHopDong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKHopDong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKHopDong = value;
            }
        }

        internal virtual CheckBox CKKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKKhachHang = value;
            }
        }

        internal virtual CheckBox CKNganHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKNganHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKNganHang = value;
            }
        }

        internal virtual CheckBox CKNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKNhanVien = value;
            }
        }

        internal virtual CheckBox CKQuy
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKQuy;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKQuy = value;
            }
        }

        internal virtual CheckBox CKSanPham
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKSanPham;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKSanPham = value;
            }
        }

        internal virtual CheckBox CKTheoDoiGiaThanh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTheoDoiGiaThanh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKTheoDoiGiaThanh_CheckedChanged);
                if (this._CKTheoDoiGiaThanh != null)
                {
                    this._CKTheoDoiGiaThanh.CheckedChanged -= handler;
                }
                this._CKTheoDoiGiaThanh = value;
                if (this._CKTheoDoiGiaThanh != null)
                {
                    this._CKTheoDoiGiaThanh.CheckedChanged += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdFind = value;
            }
        }

        internal virtual ToolStripButton CmdHelp
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdHelp;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdHelp = value;
            }
        }

        internal virtual ToolStripButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnableControl
        {
            get
            {
                return this.mEnableControl;
            }
            set
            {
                this.mEnableControl = value;
                this.TxtSoTaiKhoan.ReadOnly = !value;
                this.TxtTenViet.ReadOnly = !value;
                this.TxtTenAnh.ReadOnly = !value;
                this.CboCapDo.Enabled = value;
                this.CboLoaiTaiKhoan.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.CboNhom.Enabled = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.OptKhongTheoDoiDoiTuong.Enabled = value;
                this.OptDoiTuong.Enabled = value;
                this.CKCongNo.Enabled = value;
                this.CKQuy.Enabled = value;
                this.OptBinhThuong.Enabled = value;
                this.TVList.Enabled = !value;
                this.CKTheoDoiGiaThanh.Enabled = value;
                this.CKBoPhan.Enabled = value & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
                this.CKSanPham.Enabled = value & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
                this.CKHopDong.Enabled = value & (this.CKTheoDoiGiaThanh.CheckState == CheckState.Checked);
                this.GrDoiTuong.Enabled = value & this.OptDoiTuong.Checked;
            }
        }

        internal virtual GroupBox GrDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GrDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GrDoiTuong = value;
            }
        }

        internal virtual GroupBox GroupBox3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox3 = value;
            }
        }

        internal virtual GroupBox GroupBox4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._GroupBox4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._GroupBox4 = value;
            }
        }

        internal virtual ImageList ImageList1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ImageList1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ImageList1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual ContextMenuStrip MenuThemTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._MenuThemTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._MenuThemTaiKhoan = value;
            }
        }

        internal virtual ToolStripMenuItem MnuThem
        {
            [DebuggerNonUserCode]
            get
            {
                return this._MnuThem;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.MnuThem_Click);
                if (this._MnuThem != null)
                {
                    this._MnuThem.Click -= handler;
                }
                this._MnuThem = value;
                if (this._MnuThem != null)
                {
                    this._MnuThem.Click += handler;
                }
            }
        }

        internal virtual RadioButton OptBinhThuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptBinhThuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptBinhThuong = value;
            }
        }

        internal virtual RadioButton OptDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._OptDoiTuong = value;
            }
        }

        internal virtual RadioButton OptKhongTheoDoiDoiTuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._OptKhongTheoDoiDoiTuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.OptKhongTheoDoiDoiTuong_CheckedChanged);
                if (this._OptKhongTheoDoiDoiTuong != null)
                {
                    this._OptKhongTheoDoiDoiTuong.CheckedChanged -= handler;
                }
                this._OptKhongTheoDoiDoiTuong = value;
                if (this._OptKhongTheoDoiDoiTuong != null)
                {
                    this._OptKhongTheoDoiDoiTuong.CheckedChanged += handler;
                }
            }
        }

        internal virtual Panel Panel1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel1 = value;
            }
        }

        internal virtual Panel Panel2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel2 = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual TreeView TVList
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TVList;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                TreeNodeMouseClickEventHandler handler = new TreeNodeMouseClickEventHandler(this.TVList_NodeMouseClick);
                TreeViewEventHandler handler2 = new TreeViewEventHandler(this.TVList_AfterSelect);
                if (this._TVList != null)
                {
                    this._TVList.NodeMouseClick -= handler;
                    this._TVList.AfterSelect -= handler2;
                }
                this._TVList = value;
                if (this._TVList != null)
                {
                    this._TVList.NodeMouseClick += handler;
                    this._TVList.AfterSelect += handler2;
                }
            }
        }

        internal virtual TextBox TxtSoTaiKhoan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoTaiKhoan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                System.Windows.Forms.KeyPressEventHandler handler = new System.Windows.Forms.KeyPressEventHandler(this.TxtSoTaiKhoan_KeyPress);
                EventHandler handler2 = new EventHandler(this.TxtSoTaiKhoan_TextChanged);
                if (this._TxtSoTaiKhoan != null)
                {
                    this._TxtSoTaiKhoan.KeyPress -= handler;
                    this._TxtSoTaiKhoan.TextChanged -= handler2;
                }
                this._TxtSoTaiKhoan = value;
                if (this._TxtSoTaiKhoan != null)
                {
                    this._TxtSoTaiKhoan.KeyPress += handler;
                    this._TxtSoTaiKhoan.TextChanged += handler2;
                }
            }
        }

        internal virtual TextBox TxtTenAnh
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenAnh;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenAnh = value;
            }
        }

        internal virtual TextBox TxtTenViet
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTenViet;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTenViet = value;
            }
        }
    }
}

